OPC UA connection
You can use OPC UA to connect to the KINGSTAR PLC Runtime and access the variables you created. The OPC UA server is always on as it is part of the KINGSTAR Windows service. However, to be able to collect HMI data, there should either be a PLC or User program with user variables registered. There are many OPC UA client applications, in this guide we use UaExpert as an example.
NOTE: UaExpert is a trademark of Unified Automation GmbH. The official website is https://www.unified-automation.com/.
- Install UaExpert.
- Start UaExpert. It requires you to create a certification for security control. In the New Application Instance Certificate dialog box, in the Organization box, enter your organization name, and then click OK.
- In the Unified Automation UaExpert - NewProject window, on the Server menu, click Add.
- In the Add Server dialog box, in the Configuration Name box, enter "LogicLab."
- On the Advanced tab, use the following settings:
-
Endpoint URL for KINGSTAR version after 4.4: opc.tcp://127.0.0.1:62567/IntervalZero/KINGSTAR/OpcUa/Server. 62567 is the port the OPC UA server uses. If your OPC UA client and PLC Runtime are installed on different computers, you need to enter the IP address of the computer that has PLC Runtime installed. For example, opc.tcp://192.168.1.52:62567/IntervalZero/KINGSTAR/OpcUa/Server.
-
Endpoint URL for KINGSTAR version 4.3 and before: opc.tcp://127.0.0.1:48202
-
Security Policy: None.
-
Authentication Settings: The authentication is now enabled. By default, use hmi as username with empty password. The passwords can be configured through the KINGSTAR Control Panel.
- In the Unified Automation UaExpert - NewProject window, in the Project pane, in the Servers list, click LogicLab.
- On the Server menu, click Connect.
- In the Address Space pane, expand Objects > HMI > PLC & Objects > HMI > UserVariables.
- In the PLC Objects list, expand an object and drag its variable (item with a green tag) to the Data Access View pane. You can drag multiple variables.
- In the Data Access View pane, in the Value column, check the variable's value. To write a new value to the variable, double-click the Value column and enter a new value. To know whether the variable can be read or write, in the Attributes pane, check the AccessLevel.
When you're done, click OK.